TextView: Use saner coordinate space in draw_layer.
authorAlexander Larsson <alexl@redhat.com>
Mon, 9 Nov 2015 21:18:05 +0000 (22:18 +0100)
committerAlexander Larsson <alexl@redhat.com>
Tue, 10 Nov 2015 07:39:47 +0000 (08:39 +0100)
commit0af457639dc5eb14a060183fbd3051870055c9ab
treef30bf4841ece0b752e9dd93a1ee553a62d41fec3
parentb0a6af3783a8dd50781ca921de81d3879aafbb00
TextView: Use saner coordinate space in draw_layer.

When I added the draw_layer vfunc it accidentally got passed a cairo_t
that was configured with to draw in the viewport coordinate space (rather
than the buffer coordinate space). This makes things unnecessary complex,
because you have to convert between the two.

The pixel cache is shared between the text and the layers, so there is
no way to use draw_layer to get a stationary overlay effect. Thus it makes
much more sense for the draw_layer vfunc to draw in the buffer space.

Just changing this would break ABI for existing code, so this is fixed
by adding new layer types and deprecating the old ones.

Also, we use the new layer types to fix gtk3-widget-factory.

https://bugzilla.gnome.org/show_bug.cgi?id=757856
demos/widget-factory/widget-factory.c
gtk/gtktextview.c
gtk/gtktextview.h